package com.linxz.ui.autorecycleview;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;

import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;

/**
 * @author Linxz
 * 创建日期：2019年06月04日 07:58
 * version：v4.0.1
 * 描述：
 */
public class AtuoRecyclerView extends RecyclerView {
    public AtuoRecyclerView(Context context) {
        this(context, null);
    }

    public AtuoRecyclerView(Context context, @Nullable AttributeSet attrs) {
        this(context, attrs, -1);
    }

    public AtuoRecyclerView(Context context, @Nullable AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }





    @Override
    public boolean onTouchEvent(MotionEvent e) {
        switch (e.getAction()) {
            case MotionEvent.ACTION_UP:
                startSmooth();
                break;
        }

        return super.onTouchEvent(e);
    }

    public void startSmooth() {
        smoothScrollToPosition(1000000);
    }
}
